<template>
    <div class="TownOrgan" v-loading="load">
        <h4 style="text-align: center;">镇机关人员综合评议表</h4>
        <div>
            <el-table :data="tableData">
                <el-table-column prop="indexNum" label="序号" width="60" align="center"></el-table-column>
                <el-table-column prop="commentProject" label="项目" width="120" align="center"></el-table-column>
                <el-table-column label="评议等次" align="center">
                    <el-table-column prop="good" label="好" width="100" align="center">
                        <template slot-scope="scope">
                            <el-input v-model="scope.row.good" :disabled="!disabled"></el-input>
                        </template>
                    </el-table-column>
                    <el-table-column prop="preferably" label="较好" width="100" align="center">
                        <template slot-scope="scope">
                            <el-input v-model="scope.row.preferably" :disabled="!disabled"></el-input>
                        </template>
                    </el-table-column>
                    <el-table-column prop="commonly" label="一般" width="100" align="center">
                        <template slot-scope="scope" style="width: 80px">
                            <el-input v-model="scope.row.commonly" :disabled="!disabled"></el-input>
                        </template>
                    </el-table-column>
                    <el-table-column prop="bad" label="弱" width="100" align="center">
                        <template slot-scope="scope">
                            <el-input v-model="scope.row.bad" :disabled="!disabled"></el-input>
                        </template>
                    </el-table-column>
                </el-table-column>
            </el-table>
            <div class="resultDiv">
                <div class="resultTitle">综合评议</div>
                <div class="resultContent">优秀</div>
                <div class="resultContent">称职</div>
                <div class="resultContent">基本称职</div>
                <div class="resultContent">不称职</div>
                <div class="resultContent">
                    <el-input v-model="zp.good" :disabled="!disabled"></el-input>
                </div>
                <div class="resultContent">
                    <el-input v-model="zp.preferably" :disabled="!disabled"></el-input>
                </div>
                <div class="resultContent">
                    <el-input v-model="zp.commonly" :disabled="!disabled"></el-input>
                </div>
                <div class="resultContent">
                    <el-input v-model="zp.bad" :disabled="!disabled"></el-input>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        name: "TownOrgan",
        props:{
            list:{
                type:Array
            },
            taskId:{
                type:String,
            },
            currentCun:{
                type:String,
            }
        },
        data(){
            return{
                tempTableData: [
                    {
                        indexNum:1,
                        commentProject:'政治作为',
                        commentContent : '严守政治纪律，恪守政治规矩，做到拥护党的决定，对党忠诚;坚决执行上级党委各项决策部署;做到关键时刻顶得上、豁得出;主动加强政治学习和政治历练、积累政治经验。',
                        good: 0,
                        preferably: 0,
                        commonly: 0,
                        bad: 0,
                    },
                    {
                        indexNum:2,
                        commentProject:'发展实绩',
                        commentContent : '千方百计发展壮大村集体经济;主动带领群众增收致富;大力推进农业产业发展;全心全意为群众办实事;积极改善村庄生产生活环境。',
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,

                    },
                    {
                        indexNum:3,
                        commentProject:'管理成效',
                        commentContent : '把队伍建设放在突出位置，村两委班子团结、战斗力强、作风优良;管理成效村党员队伍纯洁、风清气正、积极向上;村能人队伍管理有效、帮扶有力。',
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,

                    },
                    {
                        indexNum:4,
                        commentProject:'治理能力',
                        commentContent : '及时有效处理村级矛盾，做到小事不出村、大事不出镇;严格实行“四理能力议两公开”;积极改善和保障民生;倡导社会主，义精神文明;推进乡村法治建设，提升乡村德治水平。' ,
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,

                    },
                    {
                        indexNum:5,
                        commentProject:'服务群众',
                        commentContent : '密切联系群众，解决实际问题和困难;积极维护群众正当权利和利益;承诺践诺赢得群众信任;关心困难群体，体现党的关怀。',
                        good : 0,
                        preferably : 0,
                        commonly : 0,
                        bad : 0,

                    },

                ],
                tempZp : {
                    indexNum:6,
                    commentProject:'综合评议',
                    commentContent : ' ' ,
                    good : 0,
                    preferably : 0,
                    commonly : 0,
                    bad : 0,
                },
                tableData:[],
                zp:{},
                load : false,
                disabled:false,
                resultList:[],
            }
        },
        methods : {
            initTable(){
                this.disabled = true;
                if (this.list.length>0){
                    let temp = this.list.concat();
                    this.tableData = temp.splice(0,5);
                    this.zp = temp[0];
                }else{
                    this.tableData = this.tempTableData.concat();
                    this.zp = Object.assign(this.tempZp);
                }
                this.$nextTick(()=>{
                    this.handleTable();
                })
            },
            handleTable(){
                this.resultList = this.tableData;
                this.resultList.push(this.zp);
                this.resultList.forEach(item=>{
                    item.type = 1;
                    item.taskId = this.taskId;
                    item.districtId = this.currentCun;
                });
                this.$emit('getCunTable',this.resultList);
            },
        },
        watch:{
            'list':{
                handler:function () {
                    this.initTable();
                }
            },
        },
        mounted() {
            this.initTable();
        }

    }
</script>
<style>
    .TownOrgan .el-input--mini .el-input__inner {
        width: 80px !important;
    }
    .TownOrgan .el-input--mini .el-input__inner {
        height: 30px!important;
        line-height: 30px!important;
    }
</style>
<style scoped>
    .TownOrgan{
        width: 581px;
    }
    .TownOrgan .resultDiv{
        border-left: 1px solid #EBEEF5;
        text-align: center;
        background-color: #fff;
        height: 86px;
        font-size: 14px;
    }
    .TownOrgan .resultTitle {
        width: 180px;
        float: left;
        height: 86px;
        line-height: 86px;
        border-right:1px solid #EBEEF5;
        border-bottom:1px solid #EBEEF5;
    }
    .TownOrgan .resultContent{
        width: 100px;
        float: left;
        height: 43px;
        line-height: 43px;
        border-right:1px solid #EBEEF5;
        border-bottom:1px solid #EBEEF5;
    }
</style>


